import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: window.sessionStorage.getItem('token'),
    name: window.sessionStorage.getItem('name'),
    id: window.sessionStorage.getItem('id')
  },
  mutations: {
    userName (state, name) {
      state.token = window.sessionStorage.getItem('token')
      state.name = window.sessionStorage.getItem('name')
      state.id = window.sessionStorage.getItem('id')
    }
  },
  actions: {
  },
  modules: {
  }
})
